<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
        tr>td{
            text-align: center;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">房卡消耗记录</li>
    </ul>
</div>
<form class="layui-form serch" action="{:url('admin/record/home')}" method="post">
    <div class="layui-form-item" style="float: left;">
        <div class="layui-input-inline">
            <input type="text" name="keywords" lay-verify="title" autocomplete="off" placeholder="请输入玩家ID" class="layui-input layui-btn-sm">
        </div>

        <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">检索</button>
    </div>
</form>


    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
             <th style="text-align: center">编号</th>
            <th style="text-align: center">玩家ID</th>
            <th style="text-align: center">消耗房卡数</th>
            <th style="text-align: center">时间</th>

            <th style="text-align: center">操作</th>
        </tr>
        </thead>
        <tbody>
   {volist name="list" id="vo"}
    <tr>
  <td >{$vo.ID}</td>
        <td >{$vo.UserID}</td>
        <td>{$vo.CostCount}</td>
         <td>{$vo.CostTime}</td>
   



        <td class="operation-menu">
            <div class="layui-btn-group">
              
                <a class="layui-btn layui-btn-xs layui-btn-primary delete" id="{$vo.ID}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
            </div>
        </td>
    </tr>
    {/volist}
        </tbody>
    </table>

<div style="padding:0 20px;">{$list->render()}</div>
    {include file="public/foot"}

    <script type="text/javascript">

        $('.delete').click(function(){
            var id = $(this).attr('id');
            layer.confirm('确定要删除?', function(index) {
                $.ajax({
                    url:"{:url('admin/record/del')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                 var  url="{:url('admin/record/home')}";
                                location.href = url;
                            },1500)
                        }
                    }
                })
            })
        })
    </script>
</div>
</body>
</html>
